var Player = function(x, y, w, h)
{
	this.go = new GameObject(x, y, w, h);
	
	this.speedx = 5;
	this.speedy = 5;
	
	this.img = new Image();
	this.img.src = "Images/Mira.png";
	
	this.KeyLeft;
	this.KeyRight;
	this.KeyUp;
	this.KeyDown;
	this.Space;
	
	this.count = 10;
	
	this.update = function()
	{
		this._Input();
		this._vs_Screen();
	}
	
	this.draw = function()
	{
		graphics.DrawImage(this.img, this.go.x, this.go.y);
	}
	
	this._Input = function()
	{
		if(this.KeyLeft)
		{
			this.go.x -= this.speedx;
		}
		
		if(this.KeyRight)
		{
			this.go.x += this.speedx;
		}
		
		if(this.KeyDown)
		{
			this.go.y += this.speedy
		}
		
		if(this.KeyUp)
		{
			this.go.y -= this.speedy
		}
	}
	
	this._vs_Screen = function()
	{
		if(this.go.x + this.go.w > graphics.canvas.width)
		{
			this.go.x = graphics.canvas.width - this.go.w;
		}
		
		if(this.go.x < 0)
		{
			this.go.x = 0;
		}
		
		if(this.go.y + this.go.h > graphics.canvas.height)
		{
			this.go.y = graphics.canvas.height - this.go.h;
		}
		
		if(this.go.y < 0)
		{
			this.go.y = 0;
		}
	}
}

var player = new Player(385, 0, 30, 30);